<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/common/head.jsp"%>

    <div class="container mt-5">

      <div class="row tm-content-row">

        <div class="col-sm-12 col-md-12 col-lg-8 col-xl-12 tm-block-col">

          <div class="tm-bg-primary-dark tm-block tm-block-products">
            <h3 style="color: white">线索分配</h3>
            <div class="tm-product-table-container">
              <div>

                <form method="get" action="${pageContext.request.contextPath }/jsp/user.do">
                  <input placeholder="请输入客户关键字" name="method" class="form-control  w-25" style="float: left;">

                  <div id="s1" style="float: left;color: white;">企业名称：</div>
                  <select name="queryUserRole" class="custom-select w-25" style="float:left">
                    <c:if test="${roleList != null }">
                      <option value="0">请选择</option>
                      <option value="1">线索测试公司</option>
                      <option value="2">北大青鸟</option>
                    </c:if>
                  </select>

                  <input	class="btn btn-info" value="查 询" type="submit" id="searchbutton">
                </form>

              </div>
              <table class="table table-hover tm-table-small tm-product-table">
                <thead>
                  <tr>
                    <th scope="col">&nbsp;</th>
                    <th scope="col">联系人</th>
                    <th scope="col">企业名称</th>
                    <th scope="col">备注</th>
                    <th scope="col">区域</th>
                    <th scope="col">线索来源</th>
                    <th scope="col">创建人</th>
                    <th scope="col">分配时间</th>
                    <th scope="col">跟进者</th>
                    <th scope="col">修改</th>
                    <th scope="col">删除</th>
                    <th scope="col">&nbsp;</th>
                  </tr>
                </thead>
            <c:forEach var="clue" items="${clueList }" varStatus="status">
                <tbody>

                  <tr>
                    <th scope="row"><input type="checkbox" /></th>
                    <td class="tm-product-name">${clue.c_linkman}</td>
                    <td>${clue.e_name}</td>
                    <td>${clue.c_remark}</td>
                    <td>${clue.c_area}</td>
                    <td>
                      <c:if test="${clue.c_ctts==1}">线上咨询</c:if>
                      <c:if test="${clue.c_ctts==2}">来电咨询</c:if>
                      <c:if test="${clue.c_ctts==3}">经人介绍</c:if>
                      <c:if test="${clue.c_ctts==4}">邮件咨询</c:if>
                    </td>
                    <td>${clue.c_creator}</td>
                    <td>
                      <fmt:formatDate value="${clue.c_allocationDate}" pattern="yyyy-MM-dd"/>
                     </td>
                    <td>${clue.c_follower}</td>
                    <td>

                      <button type="button" class="tm-product-delete-link modify" data-toggle="modal" data-target="#myModal" >
                        <i class="far fa fa-edit tm-product-delete-icon" c_id="${clue.c_id}"></i>
                      </button>
                      <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="top:210px" >
                        <div class="modal-dialog" role="document">
                          <div class="modal-content">
                            <div class="modal-header">
                              <h4 class="modal-title" id="myModalLabel">线索修改</h4>
                              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            </div>
                            <form action="${pageContext.request.contextPath }/clue/updateClue2.do">
                              <div class="modal-body" >
                                <table style="text-align: right;margin-left: 80px">
                                  <input type="hidden" id="c" name="c_id" required>
                                  <tr>
                                    <td>联系人:</td>
                                    <td><input type="text" name="c_linkman" id="c_linkman" value="" required></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>企业名称:</td>
                                    <td><input type="text" name="e_name" id="e_name" value="" required></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>备注:</td>
                                    <td><input type="text" name="c_remark" id="c_remark" value="" required></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>区域:</td>
                                    <td><input type="text" name="c_area" id="c_area" value="" required></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>线索来源:</td>
                                    <td><select type="select" name="c_ctts" id="c_ctts" value="" required>
                                      <option value="1">线上咨询</option>
                                      <option value="2">来电咨询</option>
                                      <option value="3">经人介绍</option>
                                      <option value="4">邮件咨询</option>
                                    </select></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>创建人:</td>
                                    <td><input type="text" name="c_creator" id="c_creator" value="" required></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>分配时间:</td>
                                    <td><input type="date" name="c_allocationDate" id="c_allocationDate" value="" required></td>
                                    <td></td>
                                  </tr>
                                  <tr>
                                    <td>跟进者:</td>
                                    <td><input type="text" name="c_follower" id="c_follower" value="" required></td>
                                    <td></td>
                                  </tr>
                                </table>
                              </div>
                              <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                <button type="submit" class="btn btn-primary">确定</button>
                              </div>
                            </form >
                          </div>
                        </div>
                      </div>


                    </td>
                    <td>
                      <span>
                      <a href="clue/clueDeleteId1?c_id=${clue.c_id}" class="tm-product-delete-link" onclick='return del();'>
                        <i class="far fa-trash-alt tm-product-delete-icon"></i>
                      </a>
                      </span>
                    </td>
                  </tr>
                </tbody>
            </c:forEach>
              </table>
            </div>
            <!-- table container -->

            <ul class="page-num-ul clearfix" style="float: left" >
              <input type="hidden" id="totalPageCount" value="${totalPageCount}"/>
              <c:import url="rollpage.jsp">
                <c:param name="totalCount" value="${totalCount}"/>
                <c:param name="currentPageNo" value="${currentPageNo}"/>
                <c:param name="totalPageCount" value="${totalPageCount}"/>
              </c:import>
            </ul>
                <button class="btn btn-primary btn-block text-uppercase w-25 fa-pull-right">
                  删除所选
                </button>


            </div>
          </div>
        </div>

      </div>
<script type="text/javascript">

  function del(){
    if(confirm("确定要删除吗？")){
      return true;
    }else{
      return false;
    }
  }

</script>
<%@ include file="/WEB-INF/jsp/common/foot.jsp" %>
<script src="${pageContext.request.contextPath }/js/clue1.js"></script>